DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomDataSet Class / Remove Method / Remove(Predicate<DicomAttribute>) Method
The predicate to match the attributes to be removed
Example

In This Topic
    Remove(Predicate<DicomAttribute>) Method
    In This Topic
    Removes the attributes from the DataSet that match the selector
    Syntax
    'Declaration
     
    
    Public Overloads Sub Remove( _
       ByVal selector As System.Predicate(Of DicomAttribute) _
    ) 
    public void Remove( 
       System.Predicate<DicomAttribute> selector
    )

    Parameters

    selector
    The predicate to match the attributes to be removed
    Remarks

    If the appropriate data element exists in the DicomDataSet, it is removed.

    No error is generated if the requested item is not present in the DataSet.

    Example
    DicomDataSet ds = new DicomDataSet("Dataset.dcm");
    Predicate<DicomAttribute> removePatientName = attr => attr.KeywordCode == Keyword.PatientName;
    ds.Remove(removePatientName);
    var pn = ds[Keyword.PatientName].Value.ToString(); // null
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also